/**
 * @author Lenovo
 */
public class printstring {
    public void printUpper(String s) {
        String result = s.toUpperCase();
        System.out.println(result);
    }
}
public interface Printer {
    void printUpperCase(String s);
}
public class PrinterDemo {
    public void main(String[] args) {
        //Lambda简化写法
        usePrinter(s -> System.out.println(s.toUpperCase()));
        //引用对象的实例方法
        printstring ps = new printstring();
        usePrinter(ps::printUpper);
    }
}
private static void usePrinter(Printer p) {
    p.printUpperCase("HelloWorld");
}
}

public void main() {
}
